home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / E-Z Progress Bar 1.0a / How to use ChiselClass… < prev    next >
Text File  |  1995-03-14  |  2KB  |  44 lines

  1. Using the ChiselClass…
  2.  
  3. The ChiselClass was written to provide for subtle "chiseling" (or beveling) effects
  4. around rectangular objects in a window.  They are based on develop, issue 15.  There are several
  5. ways to use create chiseled effects:
  6.  
  7. • You can set default rectangles and chisel "ways"
  8.     By calling SetDefaultRect, a rectangle is stored in the class, and by calling SetChiselWay
  9.     a default chisel way (in or out) is set.  Subsequent calls of "Chisel" or "HairChisel"
  10.     will create a chiseled effect around that default rectangle.  Calls to ChiselIn() or 
  11.     ChiselOut() and the corresponding HairChisels will also use this default rectangle, but 
  12.     the "way" will be temporarily overridden.  Similarly, ChiselIn(Rect theRect) et. al. calls
  13.     will use the rectangle and way passed without changing the defaults set
  14.  
  15. • You can specify a rectangle
  16.     If you specifiy a rectangle with Chisel(Rect theRect), the default "way" is used for the
  17.     chiseling effect, whereas ChiselIn(Rect theRect) et. al. calls will completely override
  18.     any defaults (but won't change them)
  19.  
  20.  
  21. Other important info:
  22.  
  23. • Default options are: a 3 pixel chisel border, no black border (used inside the chiseling),
  24.     a dark grey and a lite grey (dirty white) for the dark/lite chiseling effects, and a chiseled-in 
  25.     effect
  26.  
  27. • Getting the rectangle that encloses a chiseled object
  28.     Use ChiselRect() and ChiselRect(Rect theRect) to obtain the rectangle that would enclose
  29.     the default rectangle and the argument rectangle, respectively
  30.     
  31. • Getting a rectangle to fill a certain chiseled rectangle
  32.     To find out what rectangle you'd have to start with to get chiseled rectangle x, use
  33.     PreChisel(Rect theRect)
  34.  
  35. • To Erase the rectangle that would be created with a chisel call, use CleanRect() and
  36.     CleanRect(Rect theRect), which will erase the default chisel rect and theRect, respectively
  37.     
  38. • To change the chisel widths, use SetChiselWidth(short width), where width is the width in pixels
  39.  
  40. • You can also set the light and dark chisel colors, as well as pass a base color to have
  41.     ChiselClass determine lighter and darker shades (though the latter feature is far from perfect
  42.     right now - if you can improve it, do it and let me know!)
  43.  
  44. • A few other options are available; check the header file